<?php

namespace App\Http\Controllers\home;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

use DB;
class TypeController extends Controller
{
    public function show($id)
    {
    	$list=DB::table('type')->get();
        $config=DB::table('config')->get();
    	//实例化要操做的物品详情表
    	$goods = DB::table("goods")->get();
        $show=DB::table('goods')->where('tid',$id)->get();
    	//判断有没有搜索的name的值
       	return view("home.type",["list"=>$list,"config"=>$config,"goods"=>$goods,'show'=>$show]);

    }
    public function doget(Request $request)
    {
        $goods = DB::table('goods')->where('tid',$request->input('id'))->get();
        echo json_encode($goods);

    }
}
